package com.xiaomuedu.controller;

import java.util.List;

import com.jfinal.core.Controller;
import com.xiaomuedu.model.Test;

public class TestController extends Controller {

	public void index(){
		List<Test> tests = Test.dao.find("select sum(num) as aa,brand from test where date>'2017-05-01' group by brand");
		for(int i=0;i<tests.size();i++)
		{
			System.out.println(tests.get(i));
			Object aa = tests.get(i).get("aa");
			String brand = tests.get(i).getStr("brand");
			System.out.println(aa.toString());
			System.out.println(brand);
		}
		setAttr("tests", tests);
		
 		render("testing.jsp");
	}

}
